set IDENTITY_INSERT DeviceInfo_t ON
declare @count int
declare @randvar NVARCHAR(20) 
declare @ip nvarchar(20)
set @count=1
set @ip=cast(cast((rand()*10000) as int)%255 as nvarchar)+'.'+
       cast(cast((rand()*10000) as int)%255 as nvarchar)+'.'+
       cast(cast((rand()*10000) as int)%255 as nvarchar)+'.'+
       cast(cast((rand()*10000) as int)%255 as nvarchar)
set @randvar=left(cast(rand()*10000 as nvarchar),3)+right(cast(rand() as varchar),4)+right(cast(rand() as varchar),4)+lower(char(65+rand()*10))+lower(char(65+rand()*10))+right(cast(rand() as varchar),3)+lower(char(65+rand()*10))+right(cast(rand() as varchar),3)
while @count<=20000
BEGIN
	insert into DeviceInfo_t
	(
		DeviceID,
		LocalIpv4,
		Port,
		Mac,
		Sn,
		ServerIP,
		ServerPort,
		DeviceName,
		DeviceDomain,
		RegistTime,
		Remark,
		DeviceStatus,
		Handle,
		ChanNum,
		StartChan,
		RemoteIPv4,
		RemotePort,
		RegisterID,
		IsCenterPreveiw,
		STSServerIP,
		STSServerPort,
		STSServeIsUse
	)
	VALUES
	(
		@count,
		'192.168.1.138',
		'5050',
		'00:9a:b1:15:a4:94',
		@randvar,
		'192.168.1.138',
		'444444',
		'444444',
		'4444444',
		'2013-04-09 19:27:11',
		'4444444444',
		2,
		'111111',
		52,
		16,
		@ip,
		'5060',
		444444,
		1,
		'2013-04-09 19:27:11',
		'2030',
		1
	)
	set @randvar=left(cast(rand()*10000 as nvarchar),3)+right(cast(rand() as varchar),4)+right(cast(rand() as varchar),4)+lower(char(65+rand()*10))+lower(char(65+rand()*10))+right(cast(rand() as varchar),3)+lower(char(65+rand()*10))+right(cast(rand() as varchar),3)
	set @ip=cast(cast((rand()*10000) as int)%255 as nvarchar)+'.'+
       cast(cast((rand()*10000) as int)%255 as nvarchar)+'.'+
       cast(cast((rand()*10000) as int)%255 as nvarchar)+'.'+
       cast(cast((rand()*10000) as int)%255 as nvarchar)
	set @count=@count+1
END

set IDENTITY_INSERT DeviceInfo_t off